package com.zmj.utils;

import java.util.HashMap;

public class Response extends HashMap {
    private  int code;
    private  String message;

    public Response(){
    }

    public  Response(int code){
        super.put("code",code);
    }

    public Response(int code,String message){
        super.put("code",code);
        super.put("message",message);
    }

    public static  Response success(){
        return  new Response(0);
    }

    public static  Response success(String message){
        return  new Response(0,message);
    }
    public static  Response error(){
        return new Response(1);
    }
    public  static  Response error(String message){
        return  new Response(1,message);
    }

    public   Response put(String k,Object v){
        super.put(k,v);
        return this;
    }
}
